package com.brkj.util.view;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.brkj.main.R;

public class BaseActivity extends BaseCoreActivity {

	protected ImageView rightBtn;
	private ImageView leftBtn;
	
	public void setReturnBtn(View.OnClickListener listener){
        leftBtn = (ImageView) findViewById(R.id.btn_left);

        leftBtn.setVisibility(View.VISIBLE);
        leftBtn.setOnClickListener(listener );
	}
	
	public void setReturnBtn(){
        leftBtn = (ImageView) findViewById(R.id.btn_left);

        leftBtn.setVisibility(View.VISIBLE);

        leftBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
	}
	
	public void setRightBtn(int iconId, View.OnClickListener listener){
		rightBtn = (ImageView) findViewById(R.id.btn_right);
        rightBtn.setVisibility(View.VISIBLE);
        rightBtn.setImageResource(iconId);

		rightBtn.setOnClickListener(listener );
	}

    public void setRightBtnIcon(int iconId){
        rightBtn = (ImageView) findViewById(R.id.btn_right);
        rightBtn.setVisibility(View.VISIBLE);
        rightBtn.setImageResource(iconId);

    }

	
	public void setActivityTitle(String text){
		TextView title = (TextView) findViewById(R.id.title);
		
		title.setText(text);
	}

}
